Refactor & simplify conversion API's#744
Merged
antonfirsov merged 21 commits intomasterfrom Oct 23, 2018
Merged
Conversation
proving that the current API is fine
keep in test code for now.
- in PixelOperations - in T4 templates - in tests
Codecov Report
@@ Coverage Diff @@
## master #744 +/- ##
==========================================
- Coverage 88.44% 88.32% -0.12%
==========================================
Files 982 983 +1
Lines 41592 41846 +254
Branches 3126 3127 +1
==========================================
+ Hits 36784 36961 +177
- Misses 4124 4203 +79
+ Partials 684 682 -2
Continue to review full report at Codecov.
|
JimBobSquarePants
approved these changes
Oct 23, 2018
Member
JimBobSquarePants
left a comment
There was a problem hiding this comment.
LGTM. Didn't know you could import templates like that and the bulk changes dropping the count param are welcome.
Maybe update the doc on IPixel but I'll leave that up to your discretion.
| @@ -32,7 +32,7 @@ public interface IPixel | |||
| /// Sets the packed representation from a scaled <see cref="Vector4"/>. | |||
Member
There was a problem hiding this comment.
We should update the docs to remove "packed"
|
|
||
| /// <summary> | ||
| /// An interface that represents a pixel type. | ||
| /// A base interface for all pixels, defining the mandatory operations to be implemented by a pixel type. |
5 tasks
antonfirsov
added a commit
to antonfirsov/ImageSharp
that referenced
this pull request
Nov 11, 2019
Refactor & simplify conversion API's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
API cleanup
1.
IPixelPackFrom***==>From***Rgba32 ToRgba32()==>void ToRgba32(ref dest)for perfToVector4andToScaledVector4were not touched: after introducing scaling to my benchmarks it turned out that the current retval form is OK2.
PixelOperations<T>PackFrom***->From***countparameter has been removed, we now followSpan.CopyTo(...)semantics, copyingsource.Lengthelements3. Bulk conversion methods on
ColorSpaceConverterPixelOperations<T>: The lastcountparameter has been removed, we now followSpan.CopyTo(...)semantics, copyingsource.LengthelementsInternal refactor
IPixelstructs and specificPixelOperations<T>implementations were moved to a (non-namespace-provider) subfolderPixelImplementations***.PixelOperations.Generated.tt) by using shared code in_Common.ttincludeMethodImpltricks inGuard